package vehicleRentSys;

/*
 * 轿车类（子类）
 */
public class Car extends MotoVehicle {
	private String type; // 汽车型号

	public Car() {

	}

	public Car(String brand, String vehicleID, int perRent, String type) {
		super(brand, vehicleID, perRent);
		this.type = type;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	// 计算轿车的租金（）重写了MotoVehicle的计算租金方法
	/*
	 * days>7天：9折 
	 * days>30天：8折 
	 * days>150天：7折
	 */
	public double calcRent(int days) {
		double price = this.getPerRent() * days;
		if (days > 7 && days <= 30) {
			price = price * 0.9;
		} else if (days > 30 && days <= 150) {
			price = price * 0.8;
		} else if (days > 150) {
			price = price * 0.7;
		}
		return price;
	}

}
